home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’91 / DAL Files / DALtool 6⁄6 (System 7.x) / DalDemoInits.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-02  |  1.4 KB  |  62 lines  |  [TEXT/KAHL]

  1. #include <DatabaseAccess.h>
  2. #include "DalDemo.h"
  3.  
  4. extern MenuHandle    gAppleMenu, gFileMenu, gEditMenu;
  5. extern Rect    gDragRect;
  6. extern DialogPtr    gLogonDialog;
  7. extern Boolean gDone, gWNEImplemented, gDALActive, gDALMonitor, gDALNewCodeFrag;
  8. extern long gTimer, gCounter;
  9. extern int gDALState;
  10.  
  11. /*** ToolBoxInit ***/
  12. ToolBoxInit()
  13. {
  14.     InitGraf( &thePort);
  15.     InitFonts();
  16.     FlushEvents(everyEvent,REMOVE_ALL_EVENTS);
  17.     InitWindows();
  18.     InitMenus();
  19.     TEInit();
  20.     InitDialogs(NIL);
  21.     InitCursor();
  22.     InitDBPack();
  23. }
  24.  
  25. /***GlobalVarInit***/
  26. void GlobalVarInit()
  27. {
  28.     gDone = FALSE;
  29.     gWNEImplemented = (NGetTrapAddress( WNE_TRAP_NUM, ToolTrap) !=
  30.         NGetTrapAddress( UNIMPL_TRAP_NUM, ToolTrap));
  31.  
  32.     gTimer = TickCount();
  33.     gCounter = 0L;
  34.     gDALState = 0;
  35.     gDALActive = FALSE;
  36.     gDALMonitor = FALSE;
  37.     gDALNewCodeFrag = FALSE;
  38. }
  39.  
  40. /*** MenuBarInit ***/
  41. MenuBarInit()
  42. {
  43.     Handle myMenuBar;
  44.     
  45.     if ((myMenuBar = GetNewMBar(RSRC_BASE)) == NIL) ErrorHandler(NO_MBAR);
  46.     SetMenuBar(myMenuBar);
  47.     if ((gAppleMenu = GetMHandle(APPLE_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
  48.     AddResMenu(gAppleMenu, 'DRVR');
  49.     if ((gFileMenu = GetMHandle(FILE_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
  50.     if ((gEditMenu = GetMHandle(EDIT_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
  51.     DrawMenuBar();
  52. }
  53.  
  54. /*** SetUpDragRect ***/
  55. SetUpDragRect()
  56. {
  57.     gDragRect = screenBits.bounds;
  58.     gDragRect.left += DRAG_THRESH;
  59.     gDragRect.right -= DRAG_THRESH;
  60.     gDragRect.bottom -= DRAG_THRESH;
  61. }
  62.